package com.vencent.spring.start;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.vencent.spring.bean.Person;

/**
 * bean的生命周期测试类
 * @author 1d
 *
 */
public class BeanLifeTest {
	@SuppressWarnings("resource")
	public static void main(String[] args) {
		System.out.println("容器开始");
		ApplicationContext application = new ClassPathXmlApplicationContext("beans.xml");
		Person per = application.getBean(Person.class);
		System.out.println(per);
		System.out.println("容器关闭");
		((ClassPathXmlApplicationContext)application).registerShutdownHook();
	}
}
